package com.fenshi.manager.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.fenshi.manager.R;
import com.fenshi.until.MethodCode;
import com.quickdv.activity.adapter.DevSimpleAdapter;
import com.quickdv.until.ViewHolder;

import java.util.List;
import java.util.Map;

/**
 * Created by lilongfei on 15/4/19.
 */
public class ListViewAdapter2 extends DevSimpleAdapter {

    public ListViewAdapter2(Context c, List<Map<String, Object>> data, int layout, String[] from, int[] to) {
        super(c, data, layout, from, to);
    }

    @Override
    protected int[] getViewID() {
        return new int[0];
    }

    @Override
    protected void renderData(int position, View convertView) {
        View view = convertView.findViewById(R.id.park_car_shadow);
        String status =(String)data.get(position).get("status");
        int s = Integer.valueOf(status);
        if (s!=(MethodCode.CarStatus.BEUSE.getValue())) {
            view.setVisibility(View.VISIBLE);
        }
        TextView textView = ViewHolder.get(convertView, R.id.park_car_type_value);
        textView.setText(MethodCode.CarStatus.BEUSE.getText(s));

        super.renderData(position, convertView);
    }
}
